#!/bin/bash

# 数据文件夹路径
data_folder="/mnt/e/语音处理/data_Chinese_English"

# 初始化空文件用于追加内容
> data_CE/wav.scp
> data_CE/text
> data_CE/data.list

# 遍历数据文件夹
for file in $data_folder/*.txt; do
    base_name=$(basename $file .txt)
    wav_file="$data_folder/$base_name.wav"
    text_content=$(cat $file | tr -d " ")

    # 追加到wav.scp
    echo "$base_name $wav_file" >> data_CE/wav.scp
    
    # 追加到text
    echo "$base_name $text_content" >> data_CE/text
    
    # 追加到data.list
    echo "$wav_file $text_content" >> data_CE/data.list
done

echo "文件生成完成: wav.scp, text, data.list"